package flc.ast.adapter;

import android.view.View;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.MyQuestionBean;
import flc.ast.bean.MyVideoBean;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;
import stark.common.basic.media.bean.AudioBean;

public class QuestionAdapter extends StkProviderMultiAdapter<MyQuestionBean> {

    public QuestionAdapter() {
        addItemProvider(new StkSingleSpanProvider(38));
        addItemProvider(new QuestionProvider());
    }

    private class QuestionProvider extends BaseItemProvider<MyQuestionBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_question;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, MyQuestionBean bean) {
            baseViewHolder.setText(R.id.tvQuestionItemName, bean.getQuestion());
            if (bean.isSelect()) {
                baseViewHolder.setImageResource(R.id.ivQuestionItemSel,R.drawable.axuanzhong);
            } else {
                baseViewHolder.setImageResource(R.id.ivQuestionItemSel,R.drawable.aweixuanzhong);
            }
        }
    }

}
